<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-3.5.1.min.js"></script>
		<script>
			function funA(){
				var $list = $(".c1");
				for(var i=0;i<$list.length;i++){
					$list[i].checked = true;
				}
			}
			function funB(){
				var $list = $(".c1");
				for(var i=0;i<$list.length;i++){
					$list[i].checked = false;
				}
			}
			function funC(){
				var $list1 = $(".c1");
				var $list2 = $(":checked");
				for(var i=0;i<$list1.length;i++){
					$list1[i].checked = true;
				}
				for(var i=0;i<$list2.length;i++){
					$list2[i].checked = false;
				}
				
			}
		</script>
	</head>
	<body>
		<button onclick="funA()">全选</button>
		<button onclick="funC()">反选</button>
		<button onclick="funB()">全不选</button>
		<hr/>
		<input type="checkbox" class="c1"/>足球
		<input type="checkbox" class="c1"/>篮球
		<input type="checkbox" class="c1"/>排球
		<input type="checkbox" class="c1"/>网球
		<input type="checkbox" class="c1"/>冰球
	</body>
</html>
